package org.zbclan.bf2.rcon.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.googlecode.janrain4j.api.engage.response.profile.Profile;

public class LoginEvent extends GwtEvent<LoginEvent.Handler> {

	public interface Handler extends EventHandler {

		Type<Handler> TYPE = new Type<Handler>();

		void onEvent(LoginEvent event);
	}

	private final Profile profile;

	public LoginEvent(Profile profile) {
		this.profile = profile;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return Handler.TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onEvent(this);
	}

	public Profile getProfile() {
		return profile;
	}
}
